import React from 'react';
import './index.less';
import {connect} from "dva";
import BaseComponent from "components/Base/BaseComponent";
import {Col, Layout, Row, Tabs} from "antd";
import PatientInfo from "../components/PatientInfo/components";
import PatientList from "../components/PatientList/components";
import TestData from "../components/TestData/components";
import TestDataHistory from "../components/TestDataHistory/components";
import TestDataChart from "../components/TestDataChart/components";

const {Content, Footer} = Layout;
const {TabPane} = Tabs;


@connect(({patientList}) => ({patientList}))
export default class extends BaseComponent {

  callback = (key) => {
    console.log(key);
  }

  render() {

    return (
      <Layout className="testData">
        <Content>
          <Row gutter={5}>
            <Col span={11}>
              <div className="list">
                <h1>检验列表</h1>
                <PatientList/>
              </div>
            </Col>

            <Col span={13}>
              <div className="list">

                <h1>检验详情</h1>
                <PatientInfo patientId={"001"}/>

                <Tabs defaultActiveKey="1" onChange={this.callback} className={"tab"}>
                  <TabPane tab="检验数据列表" key="1">
                    <TestData/>
                  </TabPane>
                  <TabPane tab="历史数据回顾" key="2">
                    <TestDataHistory isScroll={true}/>
                  </TabPane>
                  <TabPane tab="历史数据折线图" key="3">
                    <TestDataChart/>
                  </TabPane>
                </Tabs>,
              </div>
            </Col>
          </Row>
        </Content>
      </Layout>
    );
  }

}
